package cn.xdf;

import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@EnableWebMvc
@ComponentScan("cn.xdf")
public class WebConfig implements WebMvcConfigurer {

    @Bean
    public HttpSolrServer httpSolrServer(){
        HttpSolrServer httpSolrServer =new HttpSolrServer("http://localhost:9090/solr/Goods");

        return httpSolrServer;
    }


    //静态资源放行
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer){
        configurer.enable();
    }
}
